#define UNICODE
#define _UNICODE
#define _WIN32_WINNT 0x0500

#include "ODBC.h"
#include "Md5A.h"
#include "shellapi.h"
#include <stdio.h>
#include <tchar.h>
#include <time.h>
#include <windows.h>
#include <sddl.h>
#include <stdio.h>
#include <TCHAR.H>
#include <lm.h>

class vHost{
protected:
	TCHAR Imail[1024],Table[1024], Path[1024];
	TCHAR ServU[1024],RunAs[1024];
	TCHAR MyODBC[1024],MyUser[1024],MyPassword[1024];
	TCHAR MsODBC[1024],MsUser[1024],MsPassword[1024],MsSQLPath[1024];
	TCHAR vHostODBC[1024],vHostUser[1024],vHostPassword[1024];
	odbc MsSQL,MySQL;
	odbc vHostDB;
	int RewriteOrderState(TCHAR * state);

public:
	vHost();
	void CreateSite(void);
	
	int CreateMySQL(TCHAR * DBUserName,TCHAR * DBPassWord,TCHAR * DBDatabase,TCHAR * DBSize);
	int ChangeMySQLSize(TCHAR * DBDatabase,TCHAR * DBSize);
	int ChangeMySQLPassword(TCHAR * DBUserName,TCHAR * DBPassWord);
	
	int CreateMsSQL(TCHAR * DBUserName,TCHAR * DBPassWord,TCHAR * DBDatabase,TCHAR * DBSize);
	int ChangeMsSQLSize(TCHAR * DBDatabase,TCHAR * DBSize);
	int ChangeMsSQLPassword(TCHAR * DBUserName,TCHAR * DBPassWord);
	
	int CreateFtp(TCHAR * Username,TCHAR * Password,TCHAR * Path,TCHAR * Size);
	int ChangeFtpPassword(TCHAR * Username,TCHAR * Password);
	int ChangeFtpSize(TCHAR * Username,TCHAR * Size);
	
	int CreateMail(TCHAR * Domain,TCHAR *Size,TCHAR * Usernumber);
	int ChangeMailPassword(TCHAR * Domain,TCHAR * Password);
	int ChangeMailSize(TCHAR * Domain,TCHAR * Usernumber,TCHAR * Size=TEXT("5000000"));
	int CreateIIS(TCHAR * Domain,TCHAR * Path,TCHAR * ID);
	void OutputError();
	BOOL CreateMyDACL(SECURITY_ATTRIBUTES *,PTCHAR UserName,PTCHAR RunAs);
	BOOL CreateSiteDir(PTCHAR Directory,PTCHAR UserName,PTCHAR RunAs);
	int CreateUser(PTCHAR UserName,PTCHAR Password);
	~vHost();
	
};

